package cn.itsource.easyexcel.write;

import cn.itsource.constant.Constant;
import cn.itsource.vo.DemoMergeData;
import com.alibaba.excel.EasyExcel;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 合并单元格
 */
public class WriteDemo12 {
    public static void main(String[] args) {
        String filename =  Constant.BATH_URL + "user13.xlsx";
        // 构建数据
        List<DemoMergeData> dataList = new ArrayList<>();
        DemoMergeData data = DemoMergeData.builder()
                .string("字符串")
                .date(new Date())
                .doubleData(888.88)
                .build();
        dataList.add(data);
        // 向Excel中写入数据
        EasyExcel.write(filename, DemoMergeData.class)
                .sheet("单元格合并测试")
                .doWrite(dataList);
    }
}
